package corejava2;

import java.util.Stack;

public class TestStack2 {//FILO:First In Last Out

    public static void main(String[] args) {
        Stack<Integer> s = new Stack<>();
        for (int i = 0; i < 10; i++) {
            s.push(i);//入栈
        }
        while (!s.empty()/*判断空栈*/) {
            System.out.print(s.peek());//输出栈顶元素
            s.pop();//出栈操作
        }
    }
}
